package com.ubb.dbms.core.operatorEvaluator;

import com.ubb.dbms.core.Utils.SQLExceptions.IndexKeyNullException;
import com.ubb.dbms.core.Utils.SQLExceptions.ItemAlreadyExistsException;
import com.ubb.dbms.core.Utils.SQLExceptions.ItemNotExistsException;
import com.ubb.dbms.domain.queryData.DeleteElements;
import com.ubb.dbms.domain.queryData.SelectElements;
import com.ubb.dbms.domain.queryData.TableRowElements;
import com.ubb.dbms.domain.queryResult.SelectResult;
import com.ubb.dbms.domain.xml.Database;
import com.ubb.dbms.domain.xml.IndexFile;
import com.ubb.dbms.domain.xml.Table;

public interface OperatorEvaluator {
	void manageCreateDatabase(Database database) throws ItemAlreadyExistsException;
	
	void manageUseDatabase(String databaseName);
	
	void manageCreateTable(final Table table, String databaseName) throws ItemAlreadyExistsException;
	
	void manageInsertRow(TableRowElements rowElements, String tableName, String usesDatabase) throws ItemNotExistsException, IndexKeyNullException;
	
	void manageCreateIndex(final IndexFile indexFile, final String tableName, final String usesDatabase) throws ItemNotExistsException;
	
	void manageDropDatabase(String databasename);
	
	void manageDelete(DeleteElements deleteElements, String usesDatabase) throws ItemNotExistsException;
	
	SelectResult manageSelect(SelectElements selectElements, String usesDatabase) throws ItemNotExistsException;
}

//SELECT id, name FROM table1, table2 WHERE id = 5 AND name = 'Pista';
//
//PROJECTION
//TABLES
//CONDITIONS
//
//
//(CONDITIONS): EXPRESSION: EXPRESSION and EXPRESSION
//						  EXPRESSION or EXPRESSION
//						  NOT EXPRESSION
//						  TERM OPERATION TERM
//
//			   TERM eleme (VALUE, COLUMN_NAME)
//			   VALUE eleme (int, String)
//			   OPERATION eleme (=, !=, <, >, <=, >=)
//						  